Typing the name of an occasional APL symbol within a normal text is not a real nuisance to the author of APL texts. But typesetting a larger piece of APL code certainly is. Imagine a function named , which implements a recursive tree traversal algorithm:
In order to print just the beginning of the header of the function, you would have to type:
\APLspace\APLspace\APLspace\APLspace% \APLspace\APLdel\APLZ% \APLleftarrow\APLC\APLL\APLA\APLS\APLS% \protect\APLunderbar\APLL% \APLI\APLS\APLT\APLspace\protect\APLdelta% \APLT\APLR\APLE\APLE% \APLbr\APLspace\APLR\APLO\APLO\APLT\APLbr%
Obtaining the familiar function layout used in APL textbooks would require additional code. What is more, besides being awkward the whole process is error-prone: Almost certainly it will result in a printout different from the APL code.
Therefore we strongly recommend automatic translation of APL code.
We provide an APL front end which
transforms APL objects into logical document elements which can be
\input
into LATEX documents. This
guarantees consonance between the original APL code and
its listing and is also more convenient.
For all APL language elements we have defined APL functions and corresponding LATEX environments. Our system supports the typesetting of:
As you can see, arrays and functions can be typeset in various ways. For example, the above listing of the APL function was printed by the following APL expression:
The APL function produces the file tree.tex as output. The APL front end not only maps each character into the corresponding TEX macro but it also produces the line numbers in brackets and the surrounding LATEX environments in order to guarantee uniform display of functions throughout the document.
In the following we present examples for each of the cases mentioned above. At the same time, the examples give us the opportunity to demonstrate variations of type style and size.